@extends('common.base-master')

@section('html-title')
    <title>波罗鸡-我的百宝箱</title>
@endsection

@section('html-head')
@endsection

@section('html-body')
    <div class="nav-page">
        <div class="login-header">
            @if(\Auth::guest())
            <!-- 未登录链接 -->
            <div class="login-box">
                   <div class="user-header ">
                        <div class="bg-user_b_icon"></div>
                   </div>
                <div class="login-links">
                      <a href="{{route('Home.Auth.register')}}" >注册</a>
                      <span class="border"></span>
                      <a href="{{route('Home.Auth.login')}}" >登录</a>
                </div>
            </div>
            @else
            <div class="user-info">
                <img class="user-pic" src="{{route('Api.Image.showPhotoByUserid',['id'=>$user?$user->id:0])}}">
                <div class="info-box">
                    <div class="nick-name">@if($userinfo && !is_null($userinfo)){{$userinfo->nickname}}@endif</div>
                    <div class="my-coins">我的波罗币</div>
                    <div class="coins-num">@if($userinfo && !is_null($userinfo)){{$userinfo->coin}}@endif</div>
                </div>
            </div>
            <a class="sign-link" href="{{route('Home.User.qiandao')}}">签到</a>
            @endif
        </div>
        <div class="swiper-container">
            <div class="swiper-wrapper">
                @if(count($banners) > 0)
                    @foreach($banners as $banner)
                <div class="swiper-slide"><img src="{{route("Admin.Sys.bannerSet")}}?id={{$banner->id}}" alt=""></div>
                    @endforeach
                        @endif
            </div>
            <div class="swiper-pagination"></div>
        </div>
        <div class="nav-links">
            <div class="userinfo-link nav-link">
                <a href="{{route('Home.User.userinfo')}}">
                    <span class="link-icon bg-userinfo_icon"></span>
                    <span class="des">个人信息</span>
                    <span class="right-icon bg-right_icon"></span>
                </a>
            </div>
            <div class="share-link nav-link">
                <a href="{{route('Home.User.myShare')}}">
                    <span class="link-icon bg-share_icon"></span>
                    <span class="des">分享</span>
                    <span class="right-icon bg-right_icon"></span>
                </a>
            </div>
            <div class="duihuan-link nav-link">
                <a href="{{route('Home.User.myexchange')}}?type=dfh">
                    <span class="link-icon bg-duihuan_icon"></span>
                    <span class="des">我的兑换</span>
                    <span class="right-icon bg-right_icon"></span>
                </a>
            </div>
            <div class="gif-link nav-link">
                <a href="{{route('Home.Goods.goodsList')}}">
                    <span class="link-icon bg-gif_icon"></span>
                    <span class="des">波罗币兑换</span>
                    <span class="right-icon bg-right_icon"></span>
                </a>
            </div>
            <div class="gif-link nav-link">
                <a href="{{route('Home.Goods.goodsListCash')}}">
                    <span class="link-icon bg-gif_icon"></span>
                    <span class="des">商品购买</span>
                    <span class="right-icon bg-right_icon"></span>
                </a>
            </div>
        </div>
    </div>
    <script src="{{url('js/swiper-3.4.2.jquery.min.js')}}"></script>
    <script>
        $(document).ready(function () {
            var mySwiper = new Swiper ('.swiper-container', {
                loop: true,
                autoplay : 3000,
                pagination: '.swiper-pagination',
            })
        })
    </script>
@endsection